package com.cy.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private RestTemplate restTemplate;

    @Override
    public String downPay(String orderId) {
        System.out.println("准备支付="+orderId);
        //操作数据库,扣除用户余额,发送订单id给支付系统,进行支付处理:msg为支付处理后的返回结果
        String msg = restTemplate.getForObject("http://localhost:8100/pay/"+orderId,String.class);
        return msg;
    }
}
